package com.witframework.report.dj;

import java.util.Date;

import net.sf.jasperreports.view.JasperViewer;
import ar.com.fdvs.dj.domain.DynamicReport;
import ar.com.fdvs.dj.domain.builders.FastReportBuilder;
import ar.com.fdvs.dj.test.BaseDjReportTest;

// Referenced classes of package ar.com.fdvs.dj.test:
// BaseDjReportTest

public class FastReportTest extends BaseDjReportTest {

	public FastReportTest() {
	}

	public DynamicReport buildReport() throws Exception {
		FastReportBuilder drb = new FastReportBuilder();
		drb.addColumn("State", "state", (java.lang.String.class).getName(), 30);
		drb.addColumn("Branch", "branch", (java.lang.String.class).getName(), 30);
		drb.addColumn("Product Line", "productLine", (java.lang.String.class).getName(), 50);
		drb.addColumn("Item", "item",(java.lang.String.class).getName(), 50);
		drb.addColumn("Item Code", "id", (java.lang.Long.class).getName(), 30, true);
		drb.addColumn("Quantity", "quantity", (java.lang.Long.class).getName(), 60, true);
		drb.addColumn("Amount", "amount",(java.lang.Float.class).getName(), 70, true);
		drb.addGroups(2);
		drb.setTitle("November 2006 sales report-----------");
		drb.setSubtitle("This report was generated at " + new Date());
		drb.setPrintBackgroundOnOddRows(true);
		drb.setUseFullPageWidth(true);
		DynamicReport dr = drb.build();
		return dr;
	}

	public static void main(String args[]) throws Exception {
		FastReportTest test = new FastReportTest();
		test.testReport();
		JasperViewer.viewReport(test.jp);

	}
}
